package com.supcon.exchangedata.repository.slave3;


import com.supcon.exchangedata.pojo.entity.mysql.operation.hj.GasDailyOpertionInfo;
import com.supcon.exchangedata.pojo.entity.mysql.operation.sw.WaterDailyOpertionInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *   水务日运营数据
 * @Author: yangbin
 * @Date: 2022/04/20/9:00
 * @Description:
 */
public interface SlaveSwOperationInfo extends JpaRepository<WaterDailyOpertionInfo, Long> {


    @Transactional
    @Query(nativeQuery = true, value = "SELECT * FROM water_daily_opertion_info WHERE biz_time = (SELECT MAX(biz_time) FROM water_daily_opertion_info)")
    WaterDailyOpertionInfo findTopData();

    List<WaterDailyOpertionInfo> findAllByBizTimeBetween(LocalDateTime startTime, LocalDateTime endTime);


}
